<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-acq-add">
			<div class="form-group">	
				<label class="col-sm-3 control-label">通道编码：</label>
				<div class="col-sm-8">
					<select th:if="${list!=''}" class="form-control" name="acqCode" id="acqCode"   required="required">
						<option value="">请选择</option>
						<option th:each="acqs:${list}" th:value="${acqs.company_id}"
								th:text="${acqs.company_id}"></option>
					</select>
				</div>
			</div>

			<div class="form-group">	
				<label class="col-sm-3 control-label">商户通道名称：</label>
				<div class="col-sm-8">
					<input id="acqName" name="acqName" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">通道名称：</label>
				<div class="col-sm-8">
					<textarea id="description" name="description" class="form-control"></textarea>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">单笔提现手续费：</label>
				<div class="col-sm-8">
					<input id="drawRate" name="drawRate" class="form-control" type="number">
					<label style="color: red">例:（1）</label>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">成本费率：</label>
				<div class="col-sm-8">
					<input id="costRate" name="costRate" class="form-control" type="number">
					<label style="color: red">例:（0.66）</label>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">通道单笔最大消费：</label>
				<div class="col-sm-8">
					<input id="max" name="max" class="form-control" type="number">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">通道单笔最小消费：</label>
				<div class="col-sm-8">
					<input id="min" name="min" class="form-control" type="number">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">通道支持的类型：</label>
				<div class="col-sm-8">
					<input id="supportType" name="supportType" class="form-control" type="text">
					<label style="color: red">例:（wk,yk）</label>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">是否需要签约：</label>
				<div class="col-sm-8">
					<div class="radio-box" th:each="dict : ${@dict.getType('acq_binding_type')}">
						<input type="radio" th:id="${dict.dictCode}" name="bindType" id="bindType" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">通道额度类型：</label>
				<div class="col-sm-8">
					<div class="radio-box" th:each="dict : ${@dict.getType('acq_quota_type')}">
						<input type="radio" th:id="${dict.dictCode}" name="isSmall" id="isSmall" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
					</div>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">交易权重：</label>
				<div class="col-sm-8">
					<input id="weight" name="weight" class="form-control" type="number">
				</div>
			</div>
		</form>
	</div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "system/acq"
		$("#form-acq-add").validate({
			rules:{
                acqCode:{
					required:true,
				},
                acqName:{
                    required:true,
                },
                description:{
                    required:true,
                },
                drawRate:{
                    required:true,
                },
                costRate:{
                    required:true,
                },
                max:{
                    required:true,
                },
                min:{
                    required:true,
                },
                supportType:{
                    required:true,
                },
                bindType:{
                    required:true,
                },
                isSmall:{
                    required:true,
                },
                weight:{
                    required:true,
                },
			}
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/add", $('#form-acq-add').serialize());
	        }
	    }
	</script>
</body>
</html>
